package com.ivi.car.module.carstate.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Copyright
 * author chengxp
 * date 2018/3/7
 * describe
 * history
 */

public class CarStateAdapter extends FragmentPagerAdapter {

    private final ArrayList<Fragment> mList;
    private final String[] mTitles;

    public CarStateAdapter(FragmentManager fm, String[] titles, ArrayList<Fragment> list) {
        super(fm);
        mList = list;
        mTitles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
}
